package com.charge.service.impl;

import com.charge.dao.UserSpendingTypeMapping;
import com.charge.domain.UserSpendingType;
import com.charge.service.SpendingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * Description :
 * Author : 91658
 * Date : 2018/6/11 10:25
 **/
@Service
public class SpendingServiceImpl implements SpendingService {

    @Autowired
    private UserSpendingTypeMapping userSpendingTypeMapping;

    @Override
    public void insertSpending(UserSpendingType userSpendingType) {
        userSpendingType.setCreateTime(new Date());
        userSpendingTypeMapping.insertSelective(userSpendingType);
    }

    @Override
    public List<UserSpendingType> selectSpendingList(UserSpendingType userSpendingType) {
        return userSpendingTypeMapping.selectAllSpending(userSpendingType);
    }
}
